<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport"
			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="css/app.css" />
		<style>
			.link {
				margin-top: 10px;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">注册</h1>
		</header>
		<div class="mui-content">
			<div style="padding: 10px;">
				<form class="mui-input-group">
					<div class="mui-input-row">
						<label>用户名</label>
						<input id="username" type="text" class="mui-input-clear" placeholder="请输入用户名">
					</div>
					<div class="mui-input-row">
						<label>密码</label>
						<input id="password" type="password" class="mui-password" placeholder="请输入密码">
					</div>
				</form>

				<div class="link">
					<button id="rg" type="button" class="mui-btn mui-btn-red mui-btn-block">注册</button>
				</div>
			</div>
		</div>

		<script src="js/mui.min.js"></script>
		<script src="libs/app.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			mui.init()
			document.getElementById('rg').addEventListener('tap', function() {
				post('/api/user/register', {
					username: document.getElementById("username").value.trim(),
					password: document.getElementById("password").value.trim(),
				}).then(res => {
					console.log(res);
					mui.toast(res.msg)
				})
			})
		</script>
	</body>

</html>